package com.lino.design;

/**
 * @description: 单例模式-双重锁校验(线程安全)
 * @author: lingjian
 * @createDate: 2022/12/20 8:52
 */
public class Singleton_05 {

    private static volatile Singleton_05 instance;

    private Singleton_05() {
    }

    public static Singleton_05 getInstance() {
        if (null != instance) {
            return instance;
        }
        synchronized (Singleton_05.class) {
            if (null == instance) {
                instance = new Singleton_05();
            }
        }
        return instance;
    }
}
